<template>
  <div v-show="visible" @click="hide" class="zuicoolShareMask">
    <img class="kudou" :src="kudouImg" :style="imgStyle"/>

    <p class="title" v-html="title"/>

    <p class="desc" v-if="desc" v-html="desc"/>
  </div>
</template>

<script>
  const kudouImg = require('./kudou3.png');

  export default {
    name: 'zuicool-share-mask',

    props: {
      title: {
        type: String,
        default: '分享给朋友<br/>一起读好书'
      },

      desc: {
        type: String,
      },

      show: {
        type: Boolean,
        'default': false
      }
    },

    data(){
      return {
        visible: this.show,
        kudouImg,
        imgStyle: {}
      }
    },

    watch: {
      show(val){
        this.visible = val;
      }
    },

    methods:{
      hide(){
        this.$emit('update:show', false);
        this.visible = false
      }
    }
  }
</script>

<style lang="less" scoped type="text/less">
  .zuicoolShareMask {
    z-index: 99;

    padding-top: 320px;
    width: 100%;
    height: 100%;

    position: fixed;
    top: 0;
    left: 0;
    color: #fff;

    text-align: center;
    background-color: rgba(0, 0, 0, .8);
    &:after{
      content: '';
      display: inline-block;

      position: absolute;
      top: 0;
      right: 10px;

      width: 260px;
      height: 325px;

      background: url('./share-guiding-arrow.png') center / contain no-repeat;
    }
  }

  .kudou {
    display: inline-block;

    position: absolute;
    top: 83px;
    right: 0;

    width: 164px;
  }

  .title {
    font-size: 30px;
    color: #FFF;
  }

  .desc{
    margin-top: 10px;

    font-size: 16px;
    line-height: 2;

    color: yellow;
  }

/*  .share-guiding-mask-content {
    margin-top: 20px;
    padding: 0 15px;

    font-size: 22px;
    letter-spacing: 2px;

    color: #fff;
  }*/
</style>
